home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
TUTORIAL
/
1307B.ZIP
/
ANSWERS
/
CH11E1.MOD
< prev
next >
Wrap
Text File
|
1989-01-18
|
1KB
|
57 lines
(* Chapter 11 - Programming exercise 1 *)
MODULE CH11E1;
FROM InOut IMPORT WriteString, WriteCard, WriteLn;
TYPE Name = RECORD
FirstName : ARRAY[0..12] OF CHAR;
Initial : CHAR;
LastName : ARRAY[0..12] OF CHAR;
END;
VAR Friend : ARRAY[1..5] OF Name;
Index : CARDINAL;
BEGIN (* Main Program *)
Friend[1].FirstName := "Gwen";
Friend[1].Initial := 'J';
Friend[1].LastName := "Preston";
Friend[2].FirstName := "Joe";
Friend[2].Initial := 'R';
Friend[2].LastName := "Seale";
Friend[3].FirstName := "Marvin";
Friend[3].Initial := 'E';
Friend[3].LastName := "Johnson";
Friend[4].FirstName := "Bill";
Friend[4].Initial := 'C';
Friend[4].LastName := "Williams";
Friend[5].FirstName := "Judy";
Friend[5].Initial := 'C';
Friend[5].LastName := "Birdstone";
FOR Index := 1 TO 5 DO
WriteString(Friend[Index].FirstName);
WriteString(" ");
WriteString(Friend[Index].Initial);
WriteString(" ");
WriteString(Friend[Index].LastName);
WriteLn;
END;
END CH11E1.
(* Result of execution
Gwen J Preston
Joe R Seale
Marvin E Johnson
Bill C Williams
Judy C Birdstone
*)